/**
 * @Author 韦建韩
 * @Date 2022/5/9
 */
package com.example.devops.web.controller.applicationAdmin;

import com.example.devops.entity.common.Result;
import com.example.devops.entity.pojo.User;
import com.example.devops.service.impl.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("user")
public class UserController {
    @Autowired
    UserService userService;

    @RequestMapping("register")
    public Result register(@RequestBody User user){
        return userService.save(user);
    }

    @RequestMapping("login")
    public Result login(@RequestBody User user){
        return userService.login(user);
    }

    @RequestMapping("getAllUse")
    public Result getAllUse(){
      return  userService.getAllUse();
    }
}
